import Taro, { Component } from '@tarojs/taro'
import { View , Text , Image , RichText} from '@tarojs/components';
import { baseImgSrc } from '../../util/base_url';
import { AtButton } from 'taro-ui';
import { getAns } from '../../util/api';
import './loginXieyi.scss';
export default class Xieyi extends Component {
    config = {
        navigationBarTitleText:"用户协议",
    }
    constructor(){
        super()
        this.state = {
            list:[],
        }
    }
    componentWillMount(){
        getAns({cat_id:this.$router.params.model}).then(res => {
            console.log(res)
            if(res.code == 0){
                this.setState({list:res.list});
            }
        })
    }
    render(){
        let { list } = this.state;
        return (
            <View className='xieyi'>
                {
                    list.map(v => (
                        <View  className='item'>
                            <View className='title'>{v.title}</View>
                            <RichText nodes={v.content} />
                        </View>
                    ))
                }
                
            </View>
        )
    }
}